﻿<!DOCTYPE html>
<html>
<head>
    <title>CGI</title>
</head>
<body>
    <h1>Our Page</h1>

    <script>
        try {
            throw new Error('Custom Error');
        } catch (e) {
            console.log(e.name + ' - ' + e.message);
        }


        //try {

        //    //throw new Error('Custom Error');
        //    var i = 42;
        //} catch (e) {
        //    console.log(e.name + ' - ' + e.message);
        //}
        //finally {
        //    console.log('Finally done.');
        //}

        //to compare diffrent error name
        //try {
        //    throw new RangeError('Range Error');
        //} catch (e) {
        //    if (e instanceof RangeError)
        //        console.log(e.name);
        //}

    </script>
</body>
</html>